<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}万岛潜水{% endblock %}</title>
    
    <!-- 内联关键 CSS -->
    <style>
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            color: #333;
            background-color: #f8f9fa;
        }
        .navbar {
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            background-color: #0066cc !important;
        }
        .card {
            transition: transform 0.3s, box-shadow 0.3s;
            border: none;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
        }
        .btn-primary {
            background-color: #0066cc;
            border-color: #0066cc;
        }
        footer {
            background-color: #343a40 !important;
        }
    </style>
    
    <!-- Bootstrap CSS -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/bootstrap-icons/1.8.1/font/bootstrap-icons.css" rel="stylesheet">
    
    <!-- 自定义 CSS -->
    <link href="{{ url_for('static', filename='css/style.css', v='1.0.2') }}" rel="stylesheet">
    {% block styles %}{% endblock %}

    {% assets "css_all" %}
        <link href="{{ ASSET_URL }}" rel="stylesheet">
    {% endassets %}
</head>
<body>
    <!-- 预加载器 -->
    <div id="preloader" style="position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: #fff; z-index: 9999; display: flex; justify-content: center; align-items: center;">
        <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
            <span class="visually-hidden">Loading...</span>
        </div>
    </div>

    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('main.index') }}">
                <i class="fas fa-water me-2"></i>万岛潜水
            </a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.index' %}active{% endif %}" href="{{ url_for('main.index') }}">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.about' %}active{% endif %}" href="{{ url_for('main.about') }}">关于我们</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.courses' %}active{% endif %}" href="{{ url_for('main.courses') }}">课程</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.coaches' %}active{% endif %}" href="{{ url_for('main.coaches') }}">教练团队</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.activities' %}active{% endif %}" href="{{ url_for('main.activities') }}">活动</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.knowledge' %}active{% endif %}" href="{{ url_for('main.knowledge') }}">潜水知识</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link {% if request.endpoint == 'main.contact' %}active{% endif %}" href="{{ url_for('main.contact') }}">联系我们</a>
                    </li>
                </ul>
                <ul class="navbar-nav">
                    {% if current_user.is_authenticated %}
                        {% if current_user.is_admin %}
                        <li class="nav-item">
                            <a class="nav-link" href="{{ url_for('main.admin_dashboard') }}">管理后台</a>
                        </li>
                        {% endif %}
                        <li class="nav-item">
                            <a class="nav-link" href="{{ url_for('main.profile') }}">{{ current_user.username }}</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{{ url_for('main.logout') }}">退出</a>
                        </li>
                    {% else %}
                        <li class="nav-item">
                            <a class="nav-link {% if request.endpoint == 'main.login' %}active{% endif %}" href="{{ url_for('main.login') }}">登录</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link {% if request.endpoint == 'main.register' %}active{% endif %}" href="{{ url_for('main.register') }}">注册</a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <!-- 消息提示 -->
    {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
            <div class="container mt-3">
                {% for category, message in messages %}
                    <div class="alert alert-{{ category if category != 'message' else 'info' }} alert-dismissible fade show">
                        {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
                    </div>
                {% endfor %}
            </div>
        {% endif %}
    {% endwith %}

    <!-- 主要内容 -->
    {% block content %}{% endblock %}

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-5">
        <div class="container">
            <div class="row">
                <div class="col-md-4 mb-4">
                    <h5><i class="fas fa-water me-2"></i>万岛潜水</h5>
                    <p class="mt-3">专业的潜水培训和体验中心，带您探索海底世界的奇妙。我们提供专业的潜水课程、装备租赁和潜水旅行服务。</p>
                </div>
                <div class="col-md-4 mb-4">
                    <h5><i class="fas fa-map-marker-alt me-2"></i>联系我们</h5>
                    <p class="mt-3"><i class="fas fa-map-marker-alt me-2"></i>海南省三亚市海棠湾</p>
                    <p><i class="fas fa-phone me-2"></i>400-123-4567</p>
                    <p><i class="fas fa-envelope me-2"></i>info@wandaodiving.com</p>
                    <p><i class="fas fa-clock me-2"></i>营业时间: 8:00 - 18:00</p>
                </div>
                <div class="col-md-4 mb-4">
                    <h5><i class="fas fa-share-alt me-2"></i>关注我们</h5>
                    <div class="social-icons d-flex mt-3">
                        <a href="#" class="text-white me-3"><i class="fab fa-weixin fa-2x"></i></a>
                        <a href="#" class="text-white me-3"><i class="fab fa-weibo fa-2x"></i></a>
                        <a href="#" class="text-white me-3"><i class="fab fa-tiktok fa-2x"></i></a>
                        <a href="#" class="text-white"><i class="fab fa-instagram fa-2x"></i></a>
                    </div>
                    <div class="mt-4">
                        <h6>订阅我们的新闻</h6>
                        <div class="input-group mt-2">
                            <input type="email" class="form-control" placeholder="您的邮箱">
                            <button class="btn btn-primary" type="button">订阅</button>
                        </div>
                    </div>
                </div>
            </div>
            <hr class="mt-4">
            <div class="text-center">
                <p class="mb-0">&copy; 2023 万岛潜水 版权所有 | <a href="#" class="text-white">隐私政策</a> | <a href="#" class="text-white">使用条款</a></p>
            </div>
        </div>
    </footer>

    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.3/js/bootstrap.bundle.min.js"></script>
    <script src="{{ url_for('static', filename='js/script.js', v='1.0.1') }}"></script>
    <script>
        // 页面加载完成后隐藏预加载器
        window.addEventListener('load', function() {
            document.getElementById('preloader').style.display = 'none';
        });
    </script>
    {% block scripts %}{% endblock %}

    <!-- 在页面底部添加 -->
    <div style="display:none;" id="debug-info">
        <p>CSS 文件路径: {{ url_for('static', filename='css/style.css') }}</p>
        <p>JS 文件路径: {{ url_for('static', filename='js/script.js') }}</p>
    </div>
</body>
</html> 